import React from 'react';
import { Space } from 'antd';
import styles from './index.module.less';

interface IProps {
  title?: string;
  total?: number;
  children?: React.ReactNode;
}

const Label: React.FC<IProps> = ({ title, total }) => {
  return (
    <Space>
      <span>{title}</span>
      <span>共{total}条</span>
    </Space>
  );
};

export const Title: React.FC<IProps> = ({ title, total, children }: IProps) => {
  return (
    <div className={styles['title-container']}>
      <Label title={title} total={total} />
      <Space>{children}</Space>
    </div>
  );
};
